"""
@Author : 合肥一元数智教育科技有限公司
@Date :  2025/10/29 9:49
@Description :  对象初始化  init 函数

"""
class Student:
    #  属性 成员变量
    name = None
    age = None
    sex = None
    score = None

    # 初始化函数  self 表示当前实例  动态属性添加
    def __init__(self, name, age, sex, score):
        print('student 对象被创建')
        self.name = name
        self.age = age
        self.sex = sex
        self.score = score


# 创建对像
student1 = Student('lisi', 18, 'male', 90)
print(student1.name)
student2 = Student('zhangsan', 20, 'male', 80)
print(student2.name)

# 类属性访问
class_name = Student.name
print(class_name)
